home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- I&C - The Manual
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- I&C and IOPORT are copyright 1989 by R. A. Gramann. No portion of this
- document or its accompanying programs may be reproduced without the written
- permission of R. A. Gramann.
- Table of Contents
-
- Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
-
- Copyright and plea for money . . . . . . . . . . . . . . . . . . . . . . . . . 2
-
- Advantages of Registration . . . . . . . . . . . . . . . . . . . . . . . . . . 2
-
- Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
-
- Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
-
- I&C Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- To Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
- Snap (Breakpoint). . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
-
- IOPORT Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
-
- Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
-
-
- Introduction
-
- I&C (short for Inspect and Change) is a Terminate-and-Stay-Resident (TSR)
- debugger. It is a TSR, and unlike DEBUG and CodeView, it can be used to
- debug TSR programs as they operate. Operating off of a hot key, it provides
- the following capabilities:
-
- 1. Memory inspection.
- 2. Memory modification.
- 3. Instruction breakpoint (snap) with data collection.
-
- IOPORT, included with this package allows port input and output off of a hot
- key.
-
- Unlike the standard DEBUG, this package allows you to interrupt processing
- at any time and to put a breakpoint in resident code. While it is crude (it
- requires the use of an assembly level listing), it is simple to operate and
- can be used together with higher level debuggers.
-
-
- Copyright and plea for money
-
- I&C and IOPORT are copyright 1989 by R. A. Gramann. If you find these
- programs useful, please register them by sending $22.00 to:
-
- R. A. Gramann
- 122 Laurel Ave.
- Fredericksburg, Va. 22401
-
-
- Advantages of Registration
-
- These are the advantages of being a registered owner of this software:
-
- 1. You get the satisfaction of knowing that you have paid for what you
- are using. I get some return on my effort to create this program and
- the pleasure of knowing that someone is using one of my programs.
-
- 2. I will send you a disk containing the latest version of I&C and
- IOPORT as well as the source code for these programs.
-
- 3. The disk will also contain source code for the shell of a TSR hot-
- key driven program. Supply the guts of this program to do whatever you
- want to do off of a hot key.
- Invocation
-
- To start I&C:
-
- Make sure that I&C.COM is in the current path. Then type I&C at the DOS
- prompt as shown below. I&C responds with the invocation message shown below
- identifying the hot key and stating the copyright.
-
- ┌──────────────────────────────────────────────────────────────┐
- │C:\->i&c │
- │ │
- │ I&C Installed. Hit <Ctrl><Alt> L to invoke I&C routine. │
- │ I&C copyright 1989 by R.A. Gramann │
- │C:\-> │
- └──────────────────────────────────────────────────────────────┘
-
- When invoked this way, operation of the I&C is inhibited while disk
- operations are taking place. If for some reason you want to be able to
- interrupt disk operations and risk wrecking the FAT on the disk you may be
- writing to as well as any data you may be writing, invoke I&C with /D as an
- argument. That is at the DOS prompt, type: I&C /D. If you use I&C in this
- mode, you risk destroying any disk you are writing to if you activate the hot
- key while you are writing to a disk.
-
- To start IOPORT:
-
- Make sure that IOPORT.COM is in the current path. Type IOPORT at the DOS
- prompt. IOPORT responds with the invocation message shown below identifying
- the hot key and stating the copyright. As stated above for I&C, to allow hot
- key interruptions during disk accesses, start IOPORT with the /D argument:
-
- IOPORT /D
- This permits you to destroy your disk as described above.
-
- ┌─────────────────────────────────────────────────────────────┐
- │ C:\MASM->ioport │
- │ │
- │ IOPORT Installed. Hit <Ctrl><Alt> I to invoke I/O routine. │
- │ IOPORT copyright 1989 by R.A. Gramann │
- │ C:\MASM-> │
- └─────────────────────────────────────────────────────────────┘
- Operation
-
- Note:
-
- If you plan to use CodeView after you have loaded I&C or IOPORT, you may need
- to invoke CodeView with the /S (screen swapping) option in order to get the
- I&C or IOPORT display screen when the hot key is activated.
- I&C Operation
-
- To access I&C at any time, hit <Ctrl><Alt> L together at any time. Please
- note that if you have uninhibited the disk operation lockout, that hitting
- this key combination will a disk operation is occurring will probably destroy
- that operation in sometimes unpredictable ways. (If the disk operation
- lockout is active, hitting these keys during a disk operation will have no
- effect. You'll have to wait until the disk operation is over and try again.)
-
-
- To Exit
-
- To exit I&C, hit <esc> at any time
-
-
- More on Operation
-
-
- When I&C is accessed, the screen shown below is displayed. (The original
- screen is saved, to be restored when you exit I&C.) Operation of I&C is
- possible in graphics modes since it writes to the screen through BIOS
- services, but the original graphics screens are not properly saved and will
- not be properly restored upon exit of I&C.
-
- ┌─────────────────────────────────────────────────────────────────────────┐
- │ CS=0183 IP=1C95 │
- │ │
- │ Segment Length Program │
- │ 09C6 00CA0 COMMAND.COM │
- │ 0A91 00030 unused │
- │ 0A95 00180 This block belongs to a program listed above. │
- │ 0AB4 007B0 C:\VIDEO.COM │
- │ 0B32 00630 c:\util\INSTALL.COM │
- │ 0B97 007F0 c:\util\DOSEDIT.COM │
- │ 0C1B 02B50 C:\MASM\I&C.COM │
- │ 0EC9 00060 unused │
- │ 0ED1 01420 C:\UTIL\CAPTURE.COM │
- │ 0000:0000 = 3F │
- │ Enter (B)yte, (W)ord, New (A)ddress, (N)ext, (P)revious, (C)hange, or │
- │ (R)epeat, (S)nap, (D)einstall snap: │
- │ │
- └─────────────────────────────────────────────────────────────────────────┘
-
- I&C Screen
-
- The code segment and instruction pointer at time of interrupt are shown.
- This can be helpful if you suspect you are in an infinite loop when you
- interrupt your program. You can see where you are.
-
- A map of memory follows showing the segment address, the length of each
- program in bytes, and the program name as shown in its environment block.
- Where the program name is not found within the block, I&C assumes that it
- belongs to a previously loaded program and prints the message: "This block
- belongs to a program listed above." As you use I&C this map will scroll
- upward off of the screen but it can be recalled at any time by exiting (hit
- <esc>) and reactivating I&C (hit <Ctrl> <Alt> L).
-
- The address of the program block shown is the address of the Program Segment
- Prefix preceding the program. The programs executable code begins 100h bytes
- past this address.
-
- After the memory map is the currently open inspect and change address. The
- letter in parenthesis indicates the command letter for the listed action.
- I&C is case insensitive for both command letter and hex number entries. The
- Byte and Word command affect display format. (Remember that with the 8086
- class of processors that the least significant bits are in the byte with the
- lowest address. When you display in word format, I&C puts the most
- significant byte first so that a true 16-bit value is displayed. That's why
- the byte order seems to reverse when you change formats.)
-
-
- Commands
-
- The New Address, Next, and Previous commands affect the current open address.
- Next and Previous immediately move to the indicated word or byte, depending
- on the format. New Address prompts for the entry of a new segment and
- address in hex format. The new segment entry is optional. If no segment is
- entered, the last used segment is the one that is active. If a segment is
- entered, a colon must separate the segment from the relative address. Free
- form entries are permitted for any numerical entry. Up to 4 hex digits per
- segment, address, or content value are permitted. Leading zeroes are not
- required to fill unused digit spaces. Letter entries are honored in both
- upper and lower case.
-
- The Change command permits a byte or word, depending on the format. entry
- into the currently open address. It prompts for the new contents. Either
- 2 or 4 digits will be accepted according to the format.
-
- Repeat simply redisplays the currently open cell.
-
-
- Snap (Breakpoint)
-
- The Snap and Deinstall Snap commands control the breakpoint. Snap prompts
- for the segment and address of an instruction at which execution is to pause.
- The rules for segment and address entry are the same as for the New Address
- command. Please note that if the address you enter is not the first byte of
- an executable instruction, you will witness unpredictable results as program
- execution passes through the address entered. A Snap in a ROM area will not
- operate since instructions in ROM cannot be replaced with a breakpointinstruction. I&C Snap does not get along with breakpoints installed in other
- debuggers. Please do not try to use I&C and DEBUG breakpoints together. Use
- I&C breakpoints for your interrupt processors. DEBUG won't work well with
- interrupt processor breakpoints. If you're not debugging a TSR or a resident
- interrupt processor, you'll probably want to use DEBUG or Codeview or some
- other wraparound debugger with more features than I&C.
-
- When you set the snap address to an executable instruction, the screen shown
- below appears when that instruction is executed.
-
- ┌────────────────────────────────────────────────────────────────────────┐
- │ │
- │ AX=0224 BX=0007 CX=0001 DX=0322 SP=09B6 BP=000C SI=0FA0 DI=13E9 │
- │ DS=0EDA ES=0183 SS=0183 CS=0EDA IP=023D NV UP EI PL ZR NA PE NC │
- │ 0EDA:023D │
- │ Enter <esc> to continue, anything else for I&C. │
- │ │
- └────────────────────────────────────────────────────────────────────────┘
- Snap screen
-
- where the flags are displayed as follows:
-
- OV = Overflow set, NV = Overflow clear
- DN = Direction down, UP = Direction up
- EI = Interrupt enabled, DI = Interrupt disabled
- NG = Sign negative, PL = Sign plus
- ZR = Zero, NZ = No zero
- AC = Auxiliary carry, NA = No Auxiliary carry
- PE = Parity Even. PO = Parity Odd
- CY = Carry, NC = No carry
-
-
- The contents of the registers, the flag states, and the current
- snap address are displayed. <esc> continues program execution but
- does not reset the snap address. Hitting any other key displays
- the regular I&C screen from which any address can be inspected or
- modified and from which another snap or the same snap address can
- be entered. To repeat the same snap, or to set up another snap in
- the same segment, only the lower part of the address must be
- entered. The segment address will not change unless you change it.
-
-
- IOPORT Operation
-
- To access IOPORT at any time, hit <Ctrl><Alt> I together at any
- time. Please note that if you have uninhibited the disk operation
- lockout, that hitting this key combination will a disk operation
- is occurring will probably destroy that operation in sometimes
- unpredictable ways. (If the disk operation lockout is active,hitting these keys during a disk operation will have no effect.
- You'll have to wait until the disk operation is over and try
- again.)
-
- IOPORT will save your current screen and prompt you to enter W or
- B for word or byte Input/output (IO). Note that Word IO has no
- meaning if you are not communicating with a 16 bit port. It will
- then prompt you for a port number. Enter a hex port number. It
- will then ask if you want an input or an output operation. If you
- reply with I for input, the requested port will be read and the
- result will be displayed. If you reply O for output, it will
- prompt you for the byte or word to be output. Once your entry is
- finished, an output operation will be performed on the specified
- port.
-
- You can hit <esc> at any time to exit IOPORT, or at the end of any
- operation, strike any key as prompted to go around again.
-
- Note: If you are trying to output to the printer to test this,
- remember that printer output is a 3 step operation. 1) Output the
- character to print to the printer base port. 2) Set the printer
- strobe high by outputting a hex D to the printer base port + 2.
- 3) Restore the printer strobe by outputting a hex C to the printer
- base port + 2. (The printer strobe is bit 0 of the second port
- past the printer base port.)
-
-
- Summary
-
- That's all there is to operating I&C and IOPORT. In short, invoke
- the COM files and follow the prompts. Good Luck. I hope this
- program proves useful for you. If it does, please remember to
- register.
-
- If you are a registered user, please do not distribute the source
- code that you got in return for registration. Also, please do not
- steal I&C or IOPORT and remarket it under any name. If you want
- to use my code in a program for sale, we can negotiate a license
- very cheaply. (The TSR shell is yours to use in any way that it
- helps you. No license is required to use it in a marketable
- program.)